package com.sky.mapper;

import com.sky.entity.SetmealDish;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SetMealDishMapper {

    /**
     * 根据菜品dishIds，获取所有关联的套餐id
     * @param dishIds
     * @return
     */
    List<Long> getSetMealByDishIds(List<Long> dishIds);

    /**
     * 批量插入
     * @param setmealDishes
     */
    void insertBatch(List<SetmealDish> setmealDishes);

    /**
     * 根据套餐id批量删除
     * @param setMealIds
     */
    void deleteBySetMealIds(List<Long> setMealIds);

    /**
     * 根据套餐id查询套餐菜品关系表
     * @param setMealId
     * @return
     */
    @Select("select * from setmeal_dish where setmeal_id = #{setMealId}")
    List<SetmealDish> getBySetMealId(Long setMealId);
}
